package com.example.pattern.guide

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import com.example.pattern.R
import com.example.pattern.databinding.FragmentGuideFourBinding
import com.example.pattern.utils.AnimUtils
import com.example.pattern.utils.SPUtil


class GuideFourFragment : Fragment() {
    private lateinit var binding: FragmentGuideFourBinding
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        binding = FragmentGuideFourBinding.inflate(inflater,container,false)
        binding.button.setOnClickListener {
            SPUtil.defaultUtils(requireContext()).isFirst = false
            findNavController().navigate(R.id.action_guideFragment_to_homeFragment)
        }

        return binding.root
    }

    override fun onStart() {
        super.onStart()
        AnimUtils.addRotateAndAlphaAnimation(binding.tvTitle, onEnd = {} )
        AnimUtils.addRotateAndAlphaAnimation(binding.tvDesc, onEnd = {} )
    }
}